import { Component, OnInit } from '@angular/core';
import {NzMessageService} from 'ng-zorro-antd';


@Component({
  selector: 'main',
  templateUrl: './main.component.html',
  styleUrls: ['./main.component.css']
})
export class MainComponent implements OnInit{
  title = 'main';
  array = [1];

  checkOptionsOne = [
    { label: 'Apple', value: 'Apple', checked: true },
    { label: 'Pear', value: 'Pear' },
    { label: 'Orange', value: 'Orange' },
  ];
  checkOptionsTwo = [
    { label: 'Apple', value: 'Apple' },
    { label: 'Pear', value: 'Pear', checked: true },
    { label: 'Orange', value: 'Orange' },
  ];
  checkOptionsThree = [
    { label: 'Apple', value: 'Apple', disabled: true, checked: true },
    { label: 'Pear', value: 'Pear', disabled: true },
    { label: 'Orange', value: 'Orange' },
  ];

  isVisible = false;

  showModal = () => {
    this.isVisible = true;
  };

  handleOk = (e) => {
    console.log('点击了确定');
    this.isVisible = false;
  };

  handleCancel = (e) => {
    console.log(e);
    this.isVisible = false;
  };

  _log(value) {
    console.log(value);
  }


  constructor(private _message: NzMessageService) {
  }
  ngOnInit() {
    setTimeout(_ => {
      this.array = [ 1, 2, 3, 4 ];
    }, 500)
  }

  createMessage = (type, text) => {
    this._message.create(type, `这是一条${text}提示`);
  };
}
